package com.lm.redis.controller;

import com.lm.redis.annotation.RequestLimit;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

@RestController
@RequestMapping("/test")
public class TestController {
    /**
     * 查询
     * @param pageId
     * @return
     */
    @RequestLimit(name = "token", limitTimes = 20, timeout = 60, timeUnit = TimeUnit.SECONDS)
    @GetMapping("/page/{pageId}")
    public String page(@PathVariable String pageId) {
        return "current page :" + pageId;
    }
}
